<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="css/font.css" />
		<link rel="stylesheet" href="css/common.css" />
		<link rel="stylesheet" href="css/loans.css" />
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"

			});
		</script>

	</head>
	<body>
		<header class=" header-module ">
			<div class="flex-justify-align header-top">
				<a href="home.html" class="iconfont iconfanhuijiantou header-back"></a>
				<p class="header-title">政企通-保险</p>
				<span class="header-span">
					<button type="button" class="user-btn" onclick="window.location.href='submit3.html?id=3'">立即提报</button>
				</span>
			</div>

		</header>
		<article class="middle-moudle">
			<section class="loans-data" id="loans-data">
				
			</section>
		</article>
		<footer class="footer-module">
			<nav class="flex-justify-align footer-nav ">
				<a href="home.html">
					<span class="iconfont iconshouye"></span>
					<p>首页</p>
				</a>
				<a href="apply.html">
					<span class="iconfont icontibao"></span>
					<p>提报</p>
				</a>
				<a href="setting.html">
					<span class="iconfont iconwode"></span>
					<p>我的</p>
				</a>
			</nav>
		</footer>
	</body>

	<script src="js/jquery-3.0.0.min.js"></script>
	<script src="js/gloab.js"></script>

	<script>
		$(function() {
			safe();
		});

		function safe() {
			$.ajax({
				//请求方式    
				type: "GET",
				//文件位置    
				url: basePath + "app/tcompany/getSafeInfo",
				data: "",
				//返回数据格式为json,也可以是其他格式如    
				dataType: "json",
				//请求成功拼接html    
				success: function(data) {
					console.log(data);
					if (data.msg == 'success') {
						var insurance = data.insuranceList;
						var str = "";
						$.each(insurance, function(i, n) {
							str += '<a href="pages/safe/detail.html?id=' + insurance[i].id +
								'" class="flex-justify-align base-interval loans-item">';
							str += '	<img src="'+insurance[i].logo+'" />';
							str += '	<div class="loans-info">';
							str += '		<p>' + insurance[i].productName + '</p>';
							str += '		<span>' + insurance[i].inOrganization + '</span>';
							if (insurance[i].interestRate != null) {
								str += '		<span>费率：' + insurance[i].interestRate + '</span>';
							}
							if (insurance[i].type != null) {
								str += '		<span>类型：' + insurance[i].type + '</span>';
							}
							str += '	</div>';
							str += '	<span class="iconfont iconback"></span>';
							str += '</a>';
						});
						$("#loans-data").append(str);
					}
				}
			});
		}
	</script>
</html>
